<template>
  <div
    class="singer-search find-music-cpns"
    ref="tablell"
    v-infinite-scroll="handelRequest"
  >
    <div class="sing-title">
      <div class="title-o">
        <tag-title :titles="titleOne" @changeClass="changeOne"></tag-title>
        <tag-title
          :titles="titleTwo"
          name="分类"
          @changeClass="changeTwo"
        ></tag-title>
        <tag-title
          :titles="titleThree"
          name="筛选"
          @changeClass="changeThree"
        ></tag-title>
      </div>
      <div class="singers">
        <card-item
          v-for="item in singers"
          :key="item.id"
          :item="item"
          v-bind="configObj"
        >
          <template #musictop>
            <div></div>
          </template>
        </card-item>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import TagTitle from '@/base-ui/tag-title'
import CardItem from '@/base-ui/card-item'
import { titleOne, titleTwo, titleThree } from '../hook/simulation-data'
import { InitDoing } from '../hook/singer-search'

export default defineComponent({
  components: {
    TagTitle,
    CardItem
  },
  setup() {
    const { changeOne, changeTwo, changeThree, singers, handelRequest } =
      InitDoing()
    const configObj = {
      wth: '18%',
      playShow: false,
      topShow: false,
      imgUrl: 'picUrl',
      cardType: 'singer'
    }
    return {
      titleOne,
      titleTwo,
      titleThree,
      changeOne,
      changeTwo,
      changeThree,
      singers,
      configObj,
      handelRequest
    }
  }
})
</script>

<style scoped lang="less">
.singer-search {
  width: 100%;

  .sing-title {
    width: 95%;
    margin: 0 auto;

    .title-o {
      width: 90%;
      margin: 0 auto;
      font-size: 13px;
    }

    .singers {
      width: 90%;
      margin: 0 auto;
      margin-top: 20px;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
    }
  }
}
</style>
